﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://www.caijun.net" xmlns="http://www.caijun.net" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" >
  <xs:element name="MaoCaiJunDataBase-mapping">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Namespace" minOccurs="0">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Namespace" maxOccurs="unbounded" minOccurs="0">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="Class" minOccurs="0">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="Class" maxOccurs="unbounded" minOccurs="0">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="ID" minOccurs="0">
                                  <xs:complexType>
                                    <xs:attribute name="Name" type="xs:string" use="required" />
                                    <xs:attribute name="Summary" type="xs:string" use="optional" />
                                    <xs:attribute name="Value" type="xs:string" use="required" />
                                    <xs:attribute name="Type" type="propertyType" use="required" />
                                    <xs:attribute name="SqlType" type="propertySqlType" use="required" />
                                    <xs:attribute name="SqlName" type="xs:string" use="required" />
                                    <xs:attribute name="SqlNotNull" type="bool" use="required" />
                                    <xs:attribute name="SqlLength" type="xs:string" use="required" />
                                    <xs:attribute name="SqlIndex" type="xs:string" use="required" />
                                    <xs:attribute name="SqlValue" type="xs:string" use="required" />
                                  </xs:complexType>
                                </xs:element>
                                <xs:element name="Property" minOccurs="0">
                                  <xs:complexType>
                                    <xs:sequence>
                                      <xs:element maxOccurs="unbounded" minOccurs="0" name="Property">
                                        <xs:complexType>
                                          <xs:attribute name="Name" type="xs:string" use="required" />
                                          <xs:attribute name="Summary" type="xs:string" use="optional" />
                                          <xs:attribute name="Value" type="xs:string" use="required" />
                                          <xs:attribute name="Type" type="propertyType" use="required" />
                                          <xs:attribute name="SqlType" type="propertySqlType" use="required" />
                                          <xs:attribute name="SqlName" type="xs:string" use="required" />
                                          <xs:attribute name="SqlNotNull" type="bool" use="required" />
                                          <xs:attribute name="SqlLength" type="xs:string" use="required" />
                                          <xs:attribute name="SqlIndex" type="xs:string" use="required" />
                                          <xs:attribute name="SqlValue" type="xs:string" use="required" />
                                        </xs:complexType>
                                      </xs:element>
                                    </xs:sequence>
                                  </xs:complexType>
                                </xs:element>
                              </xs:sequence>
                              <xs:attribute name="Name" type="xs:string" use="required" />
                              <xs:attribute name="Summary" type="xs:string" use="optional" />
                              <xs:attribute name="Table" type="xs:string" use="required" />
                              <xs:attribute name="ConnectionLocation" type="connectionLocation" use="required" />
                              <xs:attribute name="ConnectionString" type="xs:string" use="required" />
                              <xs:attribute name="Type" type="sqlType" use="required" />
                              <xs:attribute name="TableNameInterface" type="xs:string" use="optional" />
                              <xs:attribute name="Function" type="function" use="optional" />
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="Name" type="xs:string" use="required" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:simpleType name="bool">
    <xs:restriction base="xs:NMTOKEN">
      <xs:enumeration value="true" />
      <xs:enumeration value="false" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="connectionLocation">
    <xs:restriction base="xs:NMTOKEN">
      <xs:enumeration value="String" />
      <xs:enumeration value="StaticProperty" />
      <xs:enumeration value="Database" />
      <xs:enumeration value="ConnectionStrings" />
      <xs:enumeration value="AppSettings" />
      <xs:enumeration value="DbsFile" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="sqlType">
    <xs:restriction base="xs:NMTOKEN">
      <xs:enumeration value="Sql2008" />
      <xs:enumeration value="Sql2005" />
      <xs:enumeration value="Sql2000" />
      <xs:enumeration value="Access" />
      <xs:enumeration value="Sqlite" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="function">
    <xs:restriction base="xs:NMTOKEN">
      <xs:enumeration value="None" />
      <xs:enumeration value="Catalog" />
      <xs:enumeration value="News" />
      <xs:enumeration value="Download" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="propertyType">
    <xs:restriction base="xs:NMTOKEN">
      <xs:enumeration value="System.Boolean" />
      <xs:enumeration value="System.Byte" />
      <xs:enumeration value="System.Char" />
      <xs:enumeration value="System.DateTime" />
      <xs:enumeration value="System.Decimal" />
      <xs:enumeration value="System.Double" />
      <xs:enumeration value="System.Int16" />
      <xs:enumeration value="System.Int32" />
      <xs:enumeration value="System.Int64" />
      <xs:enumeration value="System.SByte" />
      <xs:enumeration value="System.Single" />
      <xs:enumeration value="System.String" />
      <xs:enumeration value="System.UInt16" />
      <xs:enumeration value="System.UInt32" />
      <xs:enumeration value="System.UInt64" />
      <xs:enumeration value="System.Byte"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="propertySqlType">
    <xs:restriction base="xs:NMTOKEN">
      <xs:enumeration value="varchar" />
      <xs:enumeration value="nvarchar" />
      <xs:enumeration value="decimal" />
      <xs:enumeration value="int" />
      <xs:enumeration value="bit" />
      <xs:enumeration value="datetime" />
      <xs:enumeration value="smalldatetime" />
      <xs:enumeration value="text" />
      <xs:enumeration value="boolean" />
      <xs:enumeration value="blob" />
      <xs:enumeration value="integer" />
      <xs:enumeration value="float" />
      <xs:enumeration value="numeric" />
      <xs:enumeration value="ntext" />
      <xs:enumeration value="image" />
      
    </xs:restriction>
  </xs:simpleType>
</xs:schema>
